<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <title>表格</title>
</head>
<body>
<div>
    <table border="1" cellspacing="0">
        <caption>课程表</caption>
        <thead>
        <tr>
            <th>项目</th>
            <!--            colspan="5" 横跨5列(包括1-2自己)-->
            <th colspan="5">上课</th>
            <th colspan="2">活动与休息</th>

        </tr>
        </thead>
        <tbody>
        <tr>
            <td>星期</td>
            <td>星期1</td>
            <td>星期2</td>
            <td>星期3</td>
            <td>星期4</td>
            <td>星期5</td>
            <td>星期6</td>
            <td>星期7</td>
        </tr>
        <tr>
<!--            跨行也是写在td里面,跨行会把下面的行挤到右边,等于写了4行3-1,然后4行合成1行-->
<!--            <td rowspan="4">3-1</td>-->
            <td rowspan="4">上午</td>
            <td>3-2</td>
            <td>3-3</td>
            <td>3-4</td>
            <td>3-5</td>
            <td>3-6</td>
            <td>3-7</td>
<!--            最右边写还是会被下面挤到更右边,所以要把下面的-8都删了 -->
            <td rowspan="4">休息</td>
        </tr>
        <tr>
            <td>4-2</td>
            <td>4-3</td>
            <td>4-4</td>
            <td>4-5</td>
            <td>4-6</td>
            <td>4-7</td>
<!--            <td>4-8</td>-->
        </tr>
        <tr>
            <td>5-2</td>
            <td>5-3</td>
            <td>5-4</td>
            <td>5-5</td>
            <td>5-6</td>
            <td>5-7</td>
<!--            <td>5-8</td>-->
        </tr>
        <tr>
            <td>6-2</td>
            <td>6-3</td>
            <td>6-4</td>
            <td>6-5</td>
            <td>6-6</td>
            <td>6-7</td>
<!--            <td>6-8</td>-->
        </tr>
        <tr>
            <td rowspan="2">下午</td>
            <td>7-2</td>
            <td>7-3</td>
            <td>7-4</td>
            <td>7-5</td>
            <td>7-6</td>
            <td>7-7</td>
            <td rowspan="2">上课</td>
        </tr>
        <tr>
            <td>8-2</td>
            <td>8-3</td>
            <td>8-4</td>
            <td>8-5</td>
            <td>8-6</td>
            <td>8-7</td>
        </tr>
        </tbody>

    </table>
</div>
</body>
</html>